
-- by Chris Mackey

--pieces
local base = piece "base"
local palis_1 = piece "palis_1"
local palis_2 = piece "palis_2"
local palis_3 = piece "palis_3"
local palis_4 = piece "palis_4"
local palis_5 = piece "palis_5"

--constants
local low = -20
local high = 5
local movit = 100

local sidey = 1
local x = 3
local widey = 1
local z = 3
local turney = 100


function script.Create()
	Move( palis_1, y_axis, math.random(low,high), movit )
	Move( palis_2, y_axis, math.random(low,high), movit )
	Move( palis_3, y_axis, math.random(low,high), movit )
	Move( palis_4, y_axis, math.random(low,high), movit )
	Move( palis_5, y_axis, math.random(low,high), movit )
	
	Turn( palis_1, x_axis, math.random(-sidey,sidey)/x, turney )
	Turn( palis_2, x_axis, math.random(-sidey,sidey)/x, turney )
	Turn( palis_3, x_axis, math.random(-sidey,sidey)/x, turney )
	Turn( palis_4, x_axis, math.random(-sidey,sidey)/x, turney )
	Turn( palis_5, x_axis, math.random(-sidey,sidey)/x, turney )
	
	Turn( palis_1, z_axis, math.random(-widey,widey)/z, turney )
	Turn( palis_2, z_axis, math.random(-widey,widey)/z, turney )
	Turn( palis_3, z_axis, math.random(-widey,widey)/z, turney )
	Turn( palis_4, z_axis, math.random(-widey,widey)/z, turney )
	Turn( palis_5, z_axis, math.random(-widey,widey)/z, turney )
end

function script.Killed()
	Explode( palis_1, SFX.FALL )
	Explode( palis_2, SFX.FALL )
	Explode( palis_3, SFX.FALL )
	Explode( palis_4, SFX.FALL )
	Explode( palis_5, SFX.FALL )
end
